<%@page import="com.eos.orm.mybatis.model.SysCustomer"%>
<%@page import="com.eos.orm.mybatis.model.SalesModel"%>
<%@page import="com.eos.orm.mybatis.model.SysCombo"%>
<%@page import="com.eos.orm.mybatis.model.BrokerageTempDetail"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<% 
List<BrokerageTempDetail> btdList = (List<BrokerageTempDetail>)request.getAttribute("btdList");
List<SysCombo> comboList = (List<SysCombo>) request.getAttribute("comboList");
List<SalesModel> salesList = (List<SalesModel>) request.getAttribute("salesList");
List<SysCustomer> customerList = (List<SysCustomer>) request.getAttribute("customerList");
%>
<style>
.page .searchBar label{width:90px;}
</style>
<form id="pagerForm" method="post" action="commissionList">	
	<input type="hidden" name="pageNum" value="${param.pageNum}" />	
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm"  method="post" action="commissionList">
	<div class="searchBar" >
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="pageNum" value="${pageNum}" /> 
	<table class="searchContent" >
			<tr>
				<td>
					 <label>用户号码：</label> 
                     <input type="text" class="txtinput" size="16" name="mobile" value="${mobile}"/>
				</td>
			 	<td>
					 <label>唯一码：</label> 
                     <input type="text" class="txtinput" size="16" name="barCode" value="${barCode}"/>
				</td><!--			
				<td>
					<label>结算客户：</label> 
                    <select name="customerId" class="combox">
                     	<option value="">-选择结算客户-</option>
                     	<c:forEach var="cu" items="${customerList }">
                     	<option value="${cu.id }" <c:if test="${cu.id eq customerId }">selected="selected"</c:if>>${cu.customerName }</option>
                     	</c:forEach>
                     </select>
				</td>
				<td>
					 <label  style="float:left;">结算账期：</label>
				     <input type="text" name="startTime" datefmt="yyyy-MM" value="${startTime }" size="8" class="date" style="float:left;" readonly="readonly"/>
					 <a class="inputDateButton" href="javascript:;">选择</a>
					 
					 <label style="width:10px;">~</label>
				     <input type="text" name="endTime" datefmt="yyyy-MM" size="8" value="${endTime }" class="date" style="float:left;" readonly="readonly"/>
					 <a class="inputDateButton" href="javascript:;">选择</a>
				</td>	
				-->
				<td>
					 <div class="subBar">
						<ul>
							<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
						</ul>
					</div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		</ul>
	</div>
	<table class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th>序号</th>
                <th>佣金ID</th>
                <th>结算客户</th>
                <th>地市名称</th>
                <th>结算账期</th>
                <th>用户号码</th>
                <th>产品唯一码</th>
                <th>入网日期</th>
                <th>订单号</th>
                <th>套餐</th>
                <th>销售方式</th>
                <th>话费分成值</th> 
                <th>导入时间</th>
                <th>状态</th>
			</tr>
		</thead>
		<tbody>
			<% 
			if(null != btdList){
				int i = 1;
				for(BrokerageTempDetail btd : btdList){
				   String status = btd.getStatus();
			%>
			<tr target="sid_commissionId" rel="<%=btd.getId() %>">
              	<td><%=i++ %></td>
              	<td><%=btd.getId() %></td>
              	<td>
              	<% 
              	for(SysCustomer su : customerList){
              		if(su.getId().intValue() == btd.getCustomerId()){
              			out.print(su.getCustomerName());
              			break;
              		}
              	}
              	%>
              	</td>
              	<td><%=btd.getCityName() %></td>
              	<td><%=btd.getSettlementAccount() %></td>
              	<td><%=btd.getMobile() %></td>
              	<td><%=btd.getBarCode() %></td>
              	<td><%=btd.getNetIdTime() %></td>
              	<td><%=btd.getOrderId() %></td>
              	<td>
              	<% 
              	  if(null != comboList){
              	     for(SysCombo combo : comboList){
              	     	if(combo.getId().intValue() == btd.getComboId()){
              	     		out.print(combo.getComboName()); break;
              	     	}
              	     }
              	  }
              	%>
              	</td>
              	<td>
              	<% 
              		if(null != salesList){
					for(SalesModel sm : salesList){
					   if(sm.getId().intValue() == btd.getSalesId()){
					   		out.print(sm.getSalesName());
					   		break;
					   }
					}              		
              		}
              	%>
              	</td>
              	<td style="color:#cc3333;">￥<%=btd.getBrokerageMoney() %></td>
              	<td><%=btd.getInsertTime() %></td>
              	<td>
              	<% 
              	  if(status.equals("0")){
              	  	out.print("<a style='text-decoration:none;color: #f00;'>未处理</a>");//0未处理 1已处理 2系统核对中…
              	  }else if(status.equals("1")){
              	  out.print("<a style='text-decoration:none;color: #006400;'>已处理</a>");
              	  }else if(status.equals("2")){
              	  out.print("<a style='text-decoration:none;color: #00f;'>核对中</a>");
              	  }
              	%>
              	</td>
             </tr>
			<%}
			}
			%>
		</tbody>
	</table>

	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!-- pageNum:1是当更改numPerPage时，使pageNum=1重新开始，否则可能无数据 -->
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value,pageNum:1})">
				<option value="15" ${numPerPage==15?'selected':''}>15</option>
				<option value="20" ${numPerPage==20?'selected':''}>20</option>
				<option value="25" ${numPerPage==25?'selected':''}>25</option>
				<option value="50" ${numPerPage==50?'selected':''}>50</option>
				<option value="100" ${numPerPage==100?'selected':''}>100</option>
			</select>
			<span>条，共${totalCount }条 </span>
		</div>		
		<div class="pagination" targetType="navTab" totalCount="${totalCount }" numPerPage="${numPerPage}" pageNumShown="5" currentPage="${pageNum }"></div>
	</div>
</div>
